<?php
namespace ODP\Log;

/**
 * Created by PhpStorm.
 * User: evenvi
 * Date: 16-7-1
 * Time: 下午1:57
 * Contact: ${Contact}
 */

class Log
{
    public static $_log_path;

    private function set_path()
    {
        self::$_log_path = realpath(dirname(__FILE__)) .'/log/';
    }

    public static function write($data)
    {
        self::set_path();

        if(DEBUG == 'on')
        {
            $log_filename = 'log_' . date('Ymd', time());
            file_put_contents(self::$_log_path.$log_filename, date('Y-m-d H:i:s').' '.$data."\n", FILE_APPEND);
        }
    }

}